<!DOCTYPE html>
<html lang="Zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>按键修饰符</title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="app">
        {{msg}}
        <!-- 监听enter和tab键 -->
        <input type="text" v-model="msg" @keyup.enter.tab="enterUp" />
        <input type="text" v-model="msg" @keyup.tab="keyTab" />
    </div>
</body>

</html>
<script>
    new Vue({
        el: '#app',
        data: {
            msg: 'hello world'
        },
        methods: {
            enterUp() {
                alert(this.msg)
            },
            keyTab() {
                alert('Tab键被按下')
            }
        },
        computed: {

        },
    })
</script>